import {makeAutoObservable, runInAction} from "mobx"
import { http } from '@/utils'

/**
 * 用户模块store
 * 请求路由封装类
 */
class UserStore {
  userInfo = {}
  constructor() {
    makeAutoObservable(this)
  }
  async getUserInfo() {
    const res = await http.get('/user/profile')
    runInAction(() => {
      this.userInfo = res.data
    })
  }
}

export default UserStore